/*
 * @Description: 项目管理策划明细表接口
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2022-02-15 14:59:35
 * @LastEditTime: 2022-02-28 15:06:30
 * @FilePath: \cscec-pms-admin\src\api\projectManagementPlanning\projectManagementPlanningSchedule.js
 */
import request from '@/utils/request2'
import { projectApiUrl } from '@/api/config'
const url = 'plan-producer-server'
const api = {
  list: {
    downProject: projectApiUrl + '/projects/down-project',
    getPagePlanTaskDetail: url + '/planTaskDetail/getPagePlanTaskDetail',
    signIn: url + '/planTaskDetail/signIn',
    queryPlanTaskVersionList: url + '/planTaskVersion/queryPlanTaskVersionList',
  },
  subcontractSelectionPlanning: {
    queryPlanSubSelectDetail: url + '/planSubSelect/queryPlanSubSelectDetail',
    batchUpdatePlanSubSelect: url + '/planSubSelect/batchUpdatePlanSubSelect',
  },
  greenConstructionplanning: {
    queryPlanGreenBuild: url + '/planGreenBuild/queryPlanGreenBuild',
    batchUpdatePlanGreenBuild: url + '/planGreenBuild/batchUpdatePlanGreenBuild'
  },
  smartSitePlanning: {
    queryPlanWisdomBuildingDetail: url + '/planWisdomBuilding/queryPlanWisdomBuildingDetail',
    batchUpdatePlanWisdomBuilding: url + '/planWisdomBuilding/batchUpdatePlanWisdomBuilding',
  },
  environmentalManagementMajorRisks: {
    queryPlanEnvironmentRiskControl: url + '/planEnvironmentRiskControl/queryPlanEnvironmentRiskControl',
    batchUpdatePlanEnvironmentRiskControl: url + '/planEnvironmentRiskControl/batchUpdatePlanEnvironmentRiskControl',
  },
  controlPlanningImportantNodes: {
    queryPlanCriticalNodeControl: url + '/planCriticalNodeControl/queryPlanCriticalNodeControl',
    queryScheduleMasterPlan: url + '/planCriticalNodeControl/queryScheduleMasterPlan',
    batchUpdatePlanCriticalNodeControl: url + '/planCriticalNodeControl/batchUpdatePlanCriticalNodeControl',
    getMasterPlanId: url + '/planCriticalNodeControl/getMasterPlanId'
  }
}
// 明细列表
const list = {
  /**
   * @description: 获取当前登录人项目
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  downProject: data => {
    return request({
      url: api.list.downProject,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取项目管理策划明细表列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  getPagePlanTaskDetail: data => {
    return request({
      url: api.list.getPagePlanTaskDetail,
      method: 'post',
      data
    })
  },
  /**
   * @description: 签收
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  signIn: data => {
    return request({
      url: api.list.signIn,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取版本信息
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryPlanTaskVersionList: data => {
    return request({
      url: api.list.queryPlanTaskVersionList,
      method: 'post',
      data
    })
  }
}
// 分包选择策划表
const subcontractSelectionPlanning = {
  /**
   * @description: 获取分包选择策划表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryPlanSubSelectDetail: data => {
    return request({
      url: api.subcontractSelectionPlanning.queryPlanSubSelectDetail,
      method: 'post',
      data
    })
  },
  /**
   * @description: 修改分包选择策
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  batchUpdatePlanSubSelect: data => {
    return request({
      url: api.subcontractSelectionPlanning.batchUpdatePlanSubSelect,
      method: 'post',
      data
    })
  }
}
// 绿色施工策划
const greenConstructionplanning = {
  /**
   * @description: 获取绿色施工策划详情
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryPlanGreenBuild: data => {
    return request({
      url: api.greenConstructionplanning.queryPlanGreenBuild,
      method: 'post',
      data
    })
  },
  /**
   * @description: 修改绿色施工策划
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  batchUpdatePlanGreenBuild: data => {
    return request({
      url: api.greenConstructionplanning.batchUpdatePlanGreenBuild,
      method: 'post',
      data
    })
  }
}
// 智慧工地策划
const smartSitePlanning = {
  /**
   * @description: 获取智慧工地策划详情
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryPlanWisdomBuildingDetail: data => {
    return request({
      url: api.smartSitePlanning.queryPlanWisdomBuildingDetail,
      method: 'post',
      data
    })
  },
  /**
   * @description: 修改智慧工地策划详情
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  batchUpdatePlanWisdomBuilding: data => {
    return request({
      url: api.smartSitePlanning.batchUpdatePlanWisdomBuilding,
      method: 'post',
      data
    })
  }
}
// 环境管理重大风险控制策划表
const environmentalManagementMajorRisks = {
  /**
   * @description: 获取环境管理重大风险控制策划
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryPlanEnvironmentRiskControl: data => {
    return request({
      url: api.environmentalManagementMajorRisks.queryPlanEnvironmentRiskControl,
      method: 'post',
      data
    })
  },
  /**
   * @description: 修改环境管理重大风险控制策划
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  batchUpdatePlanEnvironmentRiskControl: data => {
    return request({
      url: api.environmentalManagementMajorRisks.batchUpdatePlanEnvironmentRiskControl,
      method: 'post',
      data
    })
  },
}
// 重要节点控制策划
const controlPlanningImportantNodes = {
  /**
   * @description: 获取重要节点
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryPlanCriticalNodeControl: data => {
    return request({
      url: api.controlPlanningImportantNodes.queryPlanCriticalNodeControl,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取导入节点列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryScheduleMasterPlan: data => {
    return request({
      url: api.controlPlanningImportantNodes.queryScheduleMasterPlan,
      method: 'post',
      data
    })
  },
  /**
   * @description: 修改选中节点
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  batchUpdatePlanCriticalNodeControl: data => {
    return request({
      url: api.controlPlanningImportantNodes.batchUpdatePlanCriticalNodeControl,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取planId
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  getMasterPlanId: id => {
    return request({
      url: api.controlPlanningImportantNodes.getMasterPlanId + '?id=' +id,
      method: 'get'
    })
  }
}
export {
  list,
  subcontractSelectionPlanning,
  greenConstructionplanning,
  smartSitePlanning,
  environmentalManagementMajorRisks,
  controlPlanningImportantNodes
}
